import { request, METHOD } from '@/utils/request'

/**
 * 登录服务
 * @param name 账户名
 * @param password 账户密码
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postLogin(data) {
  return request('http://hd.fenghuangkj.com/user/login', METHOD.POST, data)
}

/**
 * 退出登录
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postLoginOut(data) {
  return request('http://hd.fenghuangkj.com/hidden/user/logout', METHOD.POST, data)
}

/**
 * 问题列表
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postQuestionList(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/list', METHOD.POST, data)
}

/**
 * 删除问题
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postQuestionDelete(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/delete', METHOD.POST, data)
}

/**
 * 添加问题 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postQuestionAdd(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/add', METHOD.POST, data)
}

/**
 * 编辑问题 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postQuestionUpdate(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/update', METHOD.POST, data)
}

/**
 * 问题详情 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getQuestionDetail(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/detail', METHOD.GET, data)
}


/**
 * 全部问题列表  
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postQuestionAllList(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/allList', METHOD.POST, data)
}

/**
 * 组织列表 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getOrgList(data) {
  return request('http://hd.fenghuangkj.com/hidden/org/list', METHOD.GET, data)
}

/**
 * 所有用户列表 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getUserAllList(data) {
  return request('http://hd.fenghuangkj.com/hidden/user/all/user/list', METHOD.GET, data)
}

/**
 * 当前账号用户列表 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getUserMyList(data) {
  return request('http://hd.fenghuangkj.com/hidden/user/list', METHOD.GET, data)
}

/**
 * 指定岗位用户列表 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getUserStationList(data) {
  return request('http://hd.fenghuangkj.com/hidden/user/stationList', METHOD.GET, data)
}

/**
 * 删除用户 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postUserDelete(data) {
  return request('http://hd.fenghuangkj.com/hidden/user/user/delete', METHOD.POST, data)
}

/**
 * 添加用户 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postUserAdd(data) {
  return request('http://hd.fenghuangkj.com/hidden/user/user/add', METHOD.POST, data)
}

/**
 * 修改用户  
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postUserUpdate(data) {
  return request('http://hd.fenghuangkj.com/hidden/user/user/update', METHOD.POST, data)
}

/**
 * 用户设置密码  
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postUserPassword(data) {
  return request('http://hd.fenghuangkj.com/user/update/password', METHOD.POST, data)
}

/**
 * 部门列表   
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getDeptList(data) {
  return request('http://hd.fenghuangkj.com/hidden/dept/list', METHOD.GET, data)
}

/**
 * 删除部门    
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postDeptDelete(data) {
  return request('http://hd.fenghuangkj.com/hidden/dept/delete'+ data, METHOD.POST)
}

/**
 * 添加部门     
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postDeptAdd(data) {
  return request('http://hd.fenghuangkj.com/hidden/dept/add', METHOD.POST, data)
}

/**
 * 编辑部门      
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postDeptUpdate(data) {
  return request('http://hd.fenghuangkj.com/hidden/dept/update', METHOD.POST, data)
}

/**
 * 部门列表   
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getDeptStation(data) {
  return request('http://hd.fenghuangkj.com/hidden/dept/station', METHOD.GET, data)
}


/**
 * 隐患记录列表   
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postHiddenList(data) {
  return request('http://hd.fenghuangkj.com/hidden/list', METHOD.POST, data)
}


/**
 * 删除隐患记录    
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postHiddenDelete(data) {
  return request('http://hd.fenghuangkj.com/hidden/delete', METHOD.POST, data)
}


/**
 * 审核隐患     
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postHiddenAudit(data) {
  return request('http://hd.fenghuangkj.com/hidden/audit', METHOD.POST, data)
}


/**
 * 将隐患置为无效      
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postHiddenInvalid(data) {
  return request('http://hd.fenghuangkj.com/hidden/invalid', METHOD.POST, data)
}


/**
 * 填写整改记录       
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postHiddenWriteMeasures(data) {
  return request('http://hd.fenghuangkj.com/hidden/writeMeasures', METHOD.POST, data)
}


/**
 * 编辑隐患记录        
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postHiddenUpdate(data) {
  return request('http://hd.fenghuangkj.com/hidden/update', METHOD.POST, data)
}


/**
 * 转派隐患 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postHiddenRedeploy(data) {
  return request('http://hd.fenghuangkj.com/hidden/redeploy', METHOD.POST, data)
}


/**
 * 表格列表 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postTableList(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/table/list', METHOD.POST, data)
}


/**
 * 全部表格列表  
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postTableAllList(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/table/allList', METHOD.POST, data)
}


/**
 * 删除表格 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postTableDelete(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/table/delete', METHOD.POST, data)
}


/**
 * 添加表格  
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postTableAdd(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/table/add', METHOD.POST, data)
}

/**
 * 编辑表格   
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postTableUpdate(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/table/update', METHOD.POST, data)
}

/**
 * 表格详情    
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getTableDetail(data) {
  return request('http://hd.fenghuangkj.com/hidden/question/table/detail', METHOD.GET, data)
}

/**
 * 检查记录列表     
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postRecordList(data) {
  return request('http://hd.fenghuangkj.com/hidden/record/list', METHOD.POST, data)
}

/**
 * 我的审核列表 
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getRecordAuditList(data) {
  return request('http://hd.fenghuangkj.com/hidden/record/auditList', METHOD.GET, data)
}

/**
 * 个人任务中心  
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getRecordMyList(data) {
  return request('http://hd.fenghuangkj.com/hidden/record/myList', METHOD.GET, data)
}

/**
 * 删除检查记录      
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postRecordDelete(data) {
  return request('http://hd.fenghuangkj.com/hidden/record/delete' + data, METHOD.POST)
}

/**
 * 添加检查记录       
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postRecordAdd(data) {
  return request('http://hd.fenghuangkj.com/hidden/record/add', METHOD.POST, data)
}


/**
 * 编辑检查记录        
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function postRecordUpdate(data) {
  return request('http://hd.fenghuangkj.com/hidden/record/update', METHOD.POST, data)
}


/**
 * 检查记录详情         
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getRecordDetail(data) {
  return request('http://hd.fenghuangkj.com/hidden/record/detail', METHOD.GET, data)
}
